#!/bin/bash
# 不输入参数，安装 
# 输入参数，配置
if [ "$1" ];then
	wget https://ftp.gwdg.de/pub/opensuse/repositories/shells%3A/zsh-users%3A/zsh-autosuggestions/xUbuntu_18.04/amd64/zsh-autosuggestions_0.7.0-1%2B3.1_amd64.deb

	sudo dpkg -i zsh-autosuggestions_0.7.0-1\+3.1_amd64.deb
	sudo apt-get install zsh-syntax-highlighting
	git clone https://github.com/robbyrussell/oh-my-zsh
	cd oh-my-zsh/tools
	./install.sh

else
	echo "修改配置文件"

	echo 'export ZSH="$HOME/.oh-my-zsh"' > ~/.zshrc
	echo 'ZSH_THEME="cloud"' >> ~/.zshrc
	echo 'ZSH_THEME="robbyrussell"' >> ~/.zshrc
	echo 'plugins=(' >> ~/.zshrc
	echo '	git' >> ~/.zshrc
	echo '	pip' >> ~/.zshrc
	echo '	zsh-autosuggestions' >> ~/.zshrc
	echo '	autojump' >> ~/.zshrc
	echo '	)' >> ~/.zshrc
	echo 'source /usr/share/zsh-autosuggestions/zsh-autosuggestions.zsh' >> ~/.zshrc
	echo 'source /usr/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh' >> ~/.zshrc
	echo 'source $ZSH/oh-my-zsh.sh' >> ~/.zshrc

fi


